<html>
  <head>
	<title><?=$page_title;?></title>
	<meta name="robots" content="noindex" />
	<link rel="stylesheet" type="text/css" href="<?=base_url()?>statics/css/api_style.css<?='?'.last_mod('statics/css/style.css')?>" />
	
	<script type="text/javascript" src="<?=base_url();?>statics/js/jquery.js"></script>
	<script type="text/javascript" src="<?=base_url();?>statics/js/jquery-jsonp-2.2.1.min.js"></script>
	<link type="text/plain" rel="author" href="<?=base_url();?>humans.txt" />
	<script type="text/javascript" src="<?=base_url();?>statics/js/superfish.js"></script>

  </head>
  <body>
  <div id="page">
	<!-- header -->
	<div id="header-outer">
		<div id="header">
			<?=$menu;?>
		</div>	
	</div>
	<!-- end of header -->

	<!-- content-outer -->
	<div id="content-outer" name="konten">
		<div id="breadcrumbs">
			<div class="breadcrumb">
				<a href="<?=base_url();?>rest">Documentation</a>
				<? if (isset($breadcrumbs) && is_array($breadcrumbs) ):
					foreach($breadcrumbs as $br):?>
						&rarr; <a href="<?=$br['uri'];?>"><?=$br['label'];?></a>
				<? endforeach; endif; ?>
				<div><span></span></div>
			</div><br/>
		</div>

		<? if (isset($dropdown) && $dropdown == TRUE): ?>
		<!-- dropdown menu -->
		<div id="preface">
			<div id="dropdown">
			<ul>
				<li><span class="title">Jump to</span>
					<ul class="menu">
						<? foreach ($api_list as $api_info): ?>
							<li><a href="<?=base_url();?>/rest/#<?=$api_info["resource"];?>"><?=$api_info["info"]["name"];?></a> (<?=count($api_info["info"]["actions"]);?>)</li>
						<? endforeach; ?>
					</ul>
				</li>
			</ul>
			</div>


		</div>
		<!-- end of dropdown menu -->
		<? endif; ?>

		<h1><?=(isset($page_title)) ? $page_title : "API Documentation";?></h1>

		<div id="content-inner">
	
		<?php if(isset($svn_version)): ?>
		
			<h5 class="codrev" style="max-width:300px;">Code Revision : <?=$svn_version;?></h5>
			
		<?php endif; ?>

		<!-- content main -->
		<div id="content-main">
			<?=$konten?>
		</div>
		<!-- end of content main -->

		<? if (isset($page_title)): ?>
		<!-- sidebar -->
		<div id="sidebar-last">
			<? if (isset($resource_info) && $resource_info == TRUE): ?>
			<div class="block api-doc-block">
				<h2>Resource Information</h2>
				<table>
					<tbody>
						<tr class="odd"><td>Rate Limited?</td><td><a href="<?=base_url();?>rest/docs/rate_limit" title="About rate limiting"><?=(isset($info["limited"]) && $info["limited"] == TRUE) ? "Yes" : "No";?></a></td> </tr>
						<tr class="even"><td>Requires Authentication?</td><td><a href="<?=base_url();?>rest/docs/access_key" title="About authentication"><?=(isset($info["public"]) && $info["public"] == TRUE) ? "No" : "Yes";?></a></td> </tr>
						<tr class="odd"><td>Response Formats</td><td>json<br/>xml<br/>html<br/>php</td> </tr>
						<tr class="even"><td>HTTP Methods</td><td><?=strtoupper($method);?></td> </tr>
					</tbody>
				</table>
			</div>
			<? endif; ?>

			<? if (isset($related_docs) && $related_docs == TRUE): ?>
			<div class="block">
				<h2>Related Documentation</h2>
				<div class="view">
					<div class="content">
						<div class="item-list">
						    <ul>
							<? foreach ($actions as $my_act): ?>
							<? if (strtoupper($my_act[0]) != strtoupper($method) && strtoupper($my_act[1]) && strtoupper($action)): ?>
							        <li class="views-row views-row-1 views-row-odd views-row-first">
									<a href="<?=base_url();?>rest/docs/<?=strtolower($my_act[0]);?>/<?=$api;?>/<?=$my_act[1];?>"><?=$my_act[0];?> <?=$api;?>/<?=$my_act[1];?></a>
								</li>
							<? endif; endforeach; ?>
						    </ul>
						</div>
					</div>
				</div>
			</div>
			<? endif; ?>
		</div>
		<? endif; ?>
		<!-- end of sidebar -->
	</div>

	<!-- end of content-outer -->
  
  <div id="footer-outer">
		<div id="footer">		
			<ul class="menu">
			<li class="leaf first"><a title="sx.Index/" href="<?=base_url()?>rest">rest.api.framework/</a></li>
			<li class="leaf">Memory Usage <?=convert(memory_get_usage(true));?></li>
			<li class="leaf last"> - &copy; <?php echo date('Y'); ?> developed by judotens.com</li>
			</ul>
		</div>
  </div>
  
  </div>
  <!-- page -->
  <script>
  $("#dropdown li ul li").hover(function() {
    $(this).addClass('hover');
  }, function() {
    $(this).removeClass('hover');
  });

  // Categories linking hack
  $("#dropdown li ul li").bind('click', function() {
    window.location.href = $(this).find('a:first').attr('href');
  });


  $("#dropdown ul").superfish({
    hoverClass:  'active',
    delay:       0,
    animation:   {opacity:'show',height:'show'},
    speed:       'fast',
    autoArrows:  false,
    dropShadows: false,
    disableHI:   true
  }).supposition();
  </script>
  </body>
</html>
